#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<unordered_map>

using namespace std;

vector<string> findHighAccessEmployees(vector<vector<string>>& access_times) {
    unordered_map<string, vector<string>> um;
    for (int i = 0; i < access_times.size(); i++)
    {
        string name = access_times[i][0];
        string time = access_times[i][1];
        um[name].push_back(time);
    }

    vector<string> res;
    for (auto& it : um)
    {
        if (it.second.size() < 3) continue;
        vector<string>& tmp = it.second;
        sort(tmp.begin(), tmp.end());
        string curtime;
        for (int i = 0; i < tmp.size(); i++)
        {
            curtime = tmp[i];
            if (curtime[1] == '9')
                curtime[0]++, curtime[1] = '0';
            else
                curtime[1]++;
            int j = 0;
            for (j = 0; j < 2 && i + j + 1 < tmp.size(); j++)
            {
                if (tmp[i + j + 1] >= curtime)
                    break;
            }
            if (j >= 2)
            {
                res.push_back(it.first);
                break;
            }
        }
    }
    return res;
}

//int main()
//{
//    vector<vector<string>> vv = { {"a","0549"},{"b","0457"},{"a","0532"},{"a","0621"}, {"b","0540"} };
//    findHighAccessEmployees(vv);
//	return 0;
//}

#include<iostream>

using namespace std;

const int N = 110;

int a[N][N];
int n;

int gauss()
{
    int r, c;
    for (r = 0, c = 0; c < n; c++)
    {
        int t = r;
        for (int i = r; i < n; i++)
        {
            if (a[i][c])
            {
                t = i;
                break;
            }
        }

        if (a[t][c] == 0)    continue;
        for (int i = c; i <= n; i++)   swap(a[t][i], a[r][i]);
        for (int i = r + 1; i < n; i++)
            if (a[i][c])
                for (int j = c; j <= n; j++)
                    a[i][j] ^= a[r][j];

        r++;
    }

    if (r < n)
    {
        for (int i = r; i < n; i++)
            if (a[i][n])
                return 2;
        return 1;
    }

    for (int i = n - 1; i >= 0; i--)
        for (int j = i + 1; j < n; j++)
            a[i][n] ^= a[i][j] & a[j][n];
    return 0;
}

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n + 1; j++)
            scanf("%d", &a[i][j]);

    int res = gauss();

    if (res == 0)
        for (int i = 0; i < n; i++)  cout << a[i][n] << endl;
    else if (res == 1) puts("Multiple sets of solutions");
    else puts("No solution");

    return 0;
}